require 'xsd/qname'

module FieldNames  #:nodoc:
  def field_names
    instance_variables.map { |var| var[1..-1] }
  end
end

# {https://services.prosper.com/ProsperAPI/}DefinitionResult
#   success - SOAP::SOAPBoolean
#   message - SOAP::SOAPString
#   definition - Definition
class DefinitionResult  #:nodoc:
  include FieldNames
  attr_accessor :success
  attr_accessor :message
  attr_accessor :definition

  def initialize(success = nil, message = nil, definition = nil)
    @success = success
    @message = message
    @definition = definition
  end
end

# {https://services.prosper.com/ProsperAPI/}Definition
#   object - SOAP::SOAPString
#   version - SOAP::SOAPString
#   description - SOAP::SOAPString
#   fields - ArrayOfField
class Definition  #:nodoc:
  include FieldNames
  attr_accessor :object
  attr_accessor :version
  attr_accessor :description
  attr_accessor :fields

  def initialize(object = nil, version = nil, description = nil, fields = nil)
    @object = object
    @version = version
    @description = description
    @fields = fields
  end
end

# {https://services.prosper.com/ProsperAPI/}ArrayOfField
class ArrayOfField < ::Array  #:nodoc:
end

# {https://services.prosper.com/ProsperAPI/}Field
#   name - SOAP::SOAPString
#   label - SOAP::SOAPString
#   type - SOAP::SOAPString
#   description - SOAP::SOAPString
#   isSearchable - SOAP::SOAPBoolean
#   authenticated - SOAP::SOAPBoolean
class Field  #:nodoc:
  include FieldNames
  attr_accessor :name
  attr_accessor :label
  attr_accessor :type
  attr_accessor :description
  attr_accessor :isSearchable
  attr_accessor :authenticated

  def initialize(name = nil, label = nil, type = nil, description = nil, isSearchable = nil, authenticated = nil)
    @name = name
    @label = label
    @type = type
    @description = description
    @isSearchable = isSearchable
    @authenticated = authenticated
  end
end

# {https://services.prosper.com/ProsperAPI/}ProsperObjectResult
#   success - SOAP::SOAPBoolean
#   message - SOAP::SOAPString
#   prosperObjects - ArrayOfProsperObject
class ProsperObjectResult  #:nodoc:
  include FieldNames
  attr_accessor :success
  attr_accessor :message
  attr_accessor :prosperObjects

  def initialize(success = nil, message = nil, prosperObjects = nil)
    @success = success
    @message = message
    @prosperObjects = prosperObjects
  end
end

# {https://services.prosper.com/ProsperAPI/}ArrayOfProsperObject
class ArrayOfProsperObject < ::Array  #:nodoc:
end

# {https://services.prosper.com/ProsperAPI/}ProsperObject
# abstract
class ProsperObject  #:nodoc:
  include FieldNames
  def initialize
  end  
end

# {https://services.prosper.com/ProsperAPI/}Loan
#   ageInMonths - SOAP::SOAPInt
#   amountBorrowed - SOAP::SOAPDecimal
#   borrowerRate - SOAP::SOAPDecimal
#   creationDate - SOAP::SOAPDateTime
#   creditGrade - SOAP::SOAPString
#   debtToIncomeRatio - SOAP::SOAPDecimal
#   groupKey - SOAP::SOAPString
#   key - SOAP::SOAPString
#   lastModifiedDate - SOAP::SOAPDateTime
#   lenderRate - SOAP::SOAPDecimal
#   listingKey - SOAP::SOAPString
#   loanOutcome - SOAP::SOAPInt
#   monthsPastDue - SOAP::SOAPDecimal
#   originationDate - SOAP::SOAPDateTime
#   servicingStatus - SOAP::SOAPInt
#   term - SOAP::SOAPInt
class Loan < ProsperObject
  attr_accessor :ageInMonths
  attr_accessor :amountBorrowed
  attr_accessor :borrowerRate
  attr_accessor :creationDate
  attr_accessor :creditGrade
  attr_accessor :debtToIncomeRatio
  attr_accessor :groupKey
  attr_accessor :key
  attr_accessor :lastModifiedDate
  attr_accessor :lenderRate
  attr_accessor :listingKey
  attr_accessor :loanOutcome
  attr_accessor :monthsPastDue
  attr_accessor :originationDate
  attr_accessor :servicingStatus
  attr_accessor :term

  def initialize(ageInMonths = nil, amountBorrowed = nil, borrowerRate = nil, creationDate = nil, creditGrade = nil, debtToIncomeRatio = nil, groupKey = nil, key = nil, lastModifiedDate = nil, lenderRate = nil, listingKey = nil, loanOutcome = nil, monthsPastDue = nil, originationDate = nil, servicingStatus = nil, term = nil)
    @ageInMonths = ageInMonths
    @amountBorrowed = amountBorrowed
    @borrowerRate = borrowerRate
    @creationDate = creationDate
    @creditGrade = creditGrade
    @debtToIncomeRatio = debtToIncomeRatio
    @groupKey = groupKey
    @key = key
    @lastModifiedDate = lastModifiedDate
    @lenderRate = lenderRate
    @listingKey = listingKey
    @loanOutcome = loanOutcome
    @monthsPastDue = monthsPastDue
    @originationDate = originationDate
    @servicingStatus = servicingStatus
    @term = term
  end
end

# {https://services.prosper.com/ProsperAPI/}Listing
#   amountDelinquent - SOAP::SOAPDecimal
#   amountFunded - SOAP::SOAPDecimal
#   amountRemaining - SOAP::SOAPDecimal
#   amountRequested - SOAP::SOAPDecimal
#   bankcardUtilization - SOAP::SOAPDecimal
#   bidCount - SOAP::SOAPInt
#   bidMaximumRate - SOAP::SOAPDecimal
#   borrowerAPR - SOAP::SOAPDecimal
#   borrowerMaximumRate - SOAP::SOAPDecimal
#   borrowerRate - SOAP::SOAPDecimal
#   borrowerState - SOAP::SOAPString
#   creationDate - SOAP::SOAPDateTime
#   creditGrade - SOAP::SOAPInt
#   currentCreditLines - SOAP::SOAPInt
#   debtToIncomeRatio - SOAP::SOAPDecimal
#   delinquenciesLast7Years - SOAP::SOAPInt
#   description - SOAP::SOAPString
#   duration - SOAP::SOAPInt
#   employmentStatus - SOAP::SOAPString
#   employmentStatusDuration - SOAP::SOAPInt
#   endDate - SOAP::SOAPDateTime
#   firstRecordedCreditLine - SOAP::SOAPDateTime
#   fundingOption - SOAP::SOAPInt
#   groupKey - SOAP::SOAPString
#   groupLeaderRewardRate - SOAP::SOAPDecimal
#   incomeRange - SOAP::SOAPString
#   inquiriesLast6Months - SOAP::SOAPInt
#   isBankAccountVerified - SOAP::SOAPBoolean
#   isBorrowerHomeowner - SOAP::SOAPBoolean
#   key - SOAP::SOAPString
#   lastModifiedDate - SOAP::SOAPDateTime
#   listingNumber - SOAP::SOAPInt
#   memberKey - SOAP::SOAPString
#   nowDelinquent - SOAP::SOAPInt
#   occupation - SOAP::SOAPString
#   openCreditLines - SOAP::SOAPInt
#   percentFunded - SOAP::SOAPDecimal
#   primaryImageURL - SOAP::SOAPString
#   publicRecordsLast10Years - SOAP::SOAPInt
#   publicRecordsLast12Months - SOAP::SOAPInt
#   revolvingCreditBalance - SOAP::SOAPDecimal
#   startDate - SOAP::SOAPDateTime
#   status - SOAP::SOAPInt
#   title - SOAP::SOAPString
#   totalCreditLines - SOAP::SOAPInt
class Listing < ProsperObject
  attr_accessor :amountDelinquent
  attr_accessor :amountFunded
  attr_accessor :amountRemaining
  attr_accessor :amountRequested
  attr_accessor :bankcardUtilization
  attr_accessor :bidCount
  attr_accessor :bidMaximumRate
  attr_accessor :borrowerAPR
  attr_accessor :borrowerMaximumRate
  attr_accessor :borrowerRate
  attr_accessor :borrowerState
  attr_accessor :creationDate
  attr_accessor :creditGrade
  attr_accessor :currentCreditLines
  attr_accessor :debtToIncomeRatio
  attr_accessor :delinquenciesLast7Years
  attr_accessor :description
  attr_accessor :duration
  attr_accessor :employmentStatus
  attr_accessor :employmentStatusDuration
  attr_accessor :endDate
  attr_accessor :firstRecordedCreditLine
  attr_accessor :fundingOption
  attr_accessor :groupKey
  attr_accessor :groupLeaderRewardRate
  attr_accessor :incomeRange
  attr_accessor :inquiriesLast6Months
  attr_accessor :isBankAccountVerified
  attr_accessor :isBorrowerHomeowner
  attr_accessor :key
  attr_accessor :lastModifiedDate
  attr_accessor :listingNumber
  attr_accessor :memberKey
  attr_accessor :nowDelinquent
  attr_accessor :occupation
  attr_accessor :openCreditLines
  attr_accessor :percentFunded
  attr_accessor :primaryImageURL
  attr_accessor :publicRecordsLast10Years
  attr_accessor :publicRecordsLast12Months
  attr_accessor :revolvingCreditBalance
  attr_accessor :startDate
  attr_accessor :status
  attr_accessor :title
  attr_accessor :totalCreditLines

  def initialize(amountDelinquent = nil, amountFunded = nil, amountRemaining = nil, amountRequested = nil, bankcardUtilization = nil, bidCount = nil, bidMaximumRate = nil, borrowerAPR = nil, borrowerMaximumRate = nil, borrowerRate = nil, borrowerState = nil, creationDate = nil, creditGrade = nil, currentCreditLines = nil, debtToIncomeRatio = nil, delinquenciesLast7Years = nil, description = nil, duration = nil, employmentStatus = nil, employmentStatusDuration = nil, endDate = nil, firstRecordedCreditLine = nil, fundingOption = nil, groupKey = nil, groupLeaderRewardRate = nil, incomeRange = nil, inquiriesLast6Months = nil, isBankAccountVerified = nil, isBorrowerHomeowner = nil, key = nil, lastModifiedDate = nil, listingNumber = nil, memberKey = nil, nowDelinquent = nil, occupation = nil, openCreditLines = nil, percentFunded = nil, primaryImageURL = nil, publicRecordsLast10Years = nil, publicRecordsLast12Months = nil, revolvingCreditBalance = nil, startDate = nil, status = nil, title = nil, totalCreditLines = nil)
    @amountDelinquent = amountDelinquent
    @amountFunded = amountFunded
    @amountRemaining = amountRemaining
    @amountRequested = amountRequested
    @bankcardUtilization = bankcardUtilization
    @bidCount = bidCount
    @bidMaximumRate = bidMaximumRate
    @borrowerAPR = borrowerAPR
    @borrowerMaximumRate = borrowerMaximumRate
    @borrowerRate = borrowerRate
    @borrowerState = borrowerState
    @creationDate = creationDate
    @creditGrade = creditGrade
    @currentCreditLines = currentCreditLines
    @debtToIncomeRatio = debtToIncomeRatio
    @delinquenciesLast7Years = delinquenciesLast7Years
    @description = description
    @duration = duration
    @employmentStatus = employmentStatus
    @employmentStatusDuration = employmentStatusDuration
    @endDate = endDate
    @firstRecordedCreditLine = firstRecordedCreditLine
    @fundingOption = fundingOption
    @groupKey = groupKey
    @groupLeaderRewardRate = groupLeaderRewardRate
    @incomeRange = incomeRange
    @inquiriesLast6Months = inquiriesLast6Months
    @isBankAccountVerified = isBankAccountVerified
    @isBorrowerHomeowner = isBorrowerHomeowner
    @key = key
    @lastModifiedDate = lastModifiedDate
    @listingNumber = listingNumber
    @memberKey = memberKey
    @nowDelinquent = nowDelinquent
    @occupation = occupation
    @openCreditLines = openCreditLines
    @percentFunded = percentFunded
    @primaryImageURL = primaryImageURL
    @publicRecordsLast10Years = publicRecordsLast10Years
    @publicRecordsLast12Months = publicRecordsLast12Months
    @revolvingCreditBalance = revolvingCreditBalance
    @startDate = startDate
    @status = status
    @title = title
    @totalCreditLines = totalCreditLines
  end
end

# {https://services.prosper.com/ProsperAPI/}Group
#   approvalDate - SOAP::SOAPDateTime
#   city - SOAP::SOAPString
#   creationDate - SOAP::SOAPDateTime
#   description - SOAP::SOAPString
#   groupLeaderRewardPercentageOfBase - SOAP::SOAPDecimal
#   groupRating - SOAP::SOAPInt
#   isAcceptingNewMembers - SOAP::SOAPBoolean
#   key - SOAP::SOAPString
#   lastModifiedDate - SOAP::SOAPDateTime
#   listingReviewRequirement - SOAP::SOAPInt
#   memberKey - SOAP::SOAPString
#   name - SOAP::SOAPString
#   shortDescription - SOAP::SOAPString
#   shortName - SOAP::SOAPString
#   state - SOAP::SOAPString
#   status - SOAP::SOAPInt
class Group < ProsperObject  #:nodoc:
  attr_accessor :approvalDate
  attr_accessor :city
  attr_accessor :creationDate
  attr_accessor :description
  attr_accessor :groupLeaderRewardPercentageOfBase
  attr_accessor :groupRating
  attr_accessor :isAcceptingNewMembers
  attr_accessor :key
  attr_accessor :lastModifiedDate
  attr_accessor :listingReviewRequirement
  attr_accessor :memberKey
  attr_accessor :name
  attr_accessor :shortDescription
  attr_accessor :shortName
  attr_accessor :state
  attr_accessor :status

  def initialize(approvalDate = nil, city = nil, creationDate = nil, description = nil, groupLeaderRewardPercentageOfBase = nil, groupRating = nil, isAcceptingNewMembers = nil, key = nil, lastModifiedDate = nil, listingReviewRequirement = nil, memberKey = nil, name = nil, shortDescription = nil, shortName = nil, state = nil, status = nil)
    @approvalDate = approvalDate
    @city = city
    @creationDate = creationDate
    @description = description
    @groupLeaderRewardPercentageOfBase = groupLeaderRewardPercentageOfBase
    @groupRating = groupRating
    @isAcceptingNewMembers = isAcceptingNewMembers
    @key = key
    @lastModifiedDate = lastModifiedDate
    @listingReviewRequirement = listingReviewRequirement
    @memberKey = memberKey
    @name = name
    @shortDescription = shortDescription
    @shortName = shortName
    @state = state
    @status = status
  end
end

# {https://services.prosper.com/ProsperAPI/}Member
#   creationDate - SOAP::SOAPDateTime
#   description - SOAP::SOAPString
#   groupKey - SOAP::SOAPString
#   key - SOAP::SOAPString
#   lastModifiedDate - SOAP::SOAPDateTime
#   roles - SOAP::SOAPInt
#   screenName - SOAP::SOAPString
class Member < ProsperObject  #:nodoc:
  attr_accessor :creationDate
  attr_accessor :description
  attr_accessor :groupKey
  attr_accessor :key
  attr_accessor :lastModifiedDate
  attr_accessor :roles
  attr_accessor :screenName

  def initialize(creationDate = nil, description = nil, groupKey = nil, key = nil, lastModifiedDate = nil, roles = nil, screenName = nil)
    @creationDate = creationDate
    @description = description
    @groupKey = groupKey
    @key = key
    @lastModifiedDate = lastModifiedDate
    @roles = roles
    @screenName = screenName
  end
end

# {https://services.prosper.com/ProsperAPI/}Marketplace
#   featuredListings - ArrayOfProsperObject
#   historicalInterestRatesTable - SOAP::SOAPString
#   loanVolumeToDate - SOAP::SOAPDecimal
#   membersToDate - SOAP::SOAPInt
class Marketplace < ProsperObject  #:nodoc:
  attr_accessor :featuredListings
  attr_accessor :historicalInterestRatesTable
  attr_accessor :loanVolumeToDate
  attr_accessor :membersToDate

  def initialize(featuredListings = nil, historicalInterestRatesTable = nil, loanVolumeToDate = nil, membersToDate = nil)
    @featuredListings = featuredListings
    @historicalInterestRatesTable = historicalInterestRatesTable
    @loanVolumeToDate = loanVolumeToDate
    @membersToDate = membersToDate
  end
end

# {https://services.prosper.com/ProsperAPI/}Bid
#   amount - SOAP::SOAPDecimal
#   creationDate - SOAP::SOAPDateTime
#   key - SOAP::SOAPString
#   lastModifiedDate - SOAP::SOAPDateTime
#   listingKey - SOAP::SOAPString
#   memberKey - SOAP::SOAPString
#   minimumRate - SOAP::SOAPDecimal
#   participationAmount - SOAP::SOAPDecimal
#   status - SOAP::SOAPInt
class Bid < ProsperObject
  attr_accessor :amount
  attr_accessor :creationDate
  attr_accessor :key
  attr_accessor :lastModifiedDate
  attr_accessor :listingKey
  attr_accessor :memberKey
  attr_accessor :minimumRate
  attr_accessor :participationAmount
  attr_accessor :status

  def initialize(amount = nil, creationDate = nil, key = nil, lastModifiedDate = nil, listingKey = nil, memberKey = nil, minimumRate = nil, participationAmount = nil, status = nil)
    @amount = amount
    @creationDate = creationDate
    @key = key
    @lastModifiedDate = lastModifiedDate
    @listingKey = listingKey
    @memberKey = memberKey
    @minimumRate = minimumRate
    @participationAmount = participationAmount
    @status = status
  end
end

# {https://services.prosper.com/ProsperAPI/}LenderLoan
#   dPD - SOAP::SOAPInt
#   key - SOAP::SOAPString
#   principalBalance - SOAP::SOAPDecimal
#   principalLoaned - SOAP::SOAPDecimal
#   principalRepaid - SOAP::SOAPDecimal
class LenderLoan < ProsperObject  #:nodoc:
  attr_accessor :dPD
  attr_accessor :key
  attr_accessor :principalBalance
  attr_accessor :principalLoaned
  attr_accessor :principalRepaid

  def initialize(dPD = nil, key = nil, principalBalance = nil, principalLoaned = nil, principalRepaid = nil)
    @dPD = dPD
    @key = key
    @principalBalance = principalBalance
    @principalLoaned = principalLoaned
    @principalRepaid = principalRepaid
  end
end

# {https://services.prosper.com/ProsperAPI/}Describe
#   authenticationToken - SOAP::SOAPString
#   objectType - SOAP::SOAPString
class Describe
  include FieldNames
  attr_accessor :authenticationToken
  attr_accessor :objectType

  def initialize(authenticationToken = nil, objectType = nil)
    @authenticationToken = authenticationToken
    @objectType = objectType
  end
end

# {https://services.prosper.com/ProsperAPI/}DescribeResponse
#   describeResult - DefinitionResult
class DescribeResponse  #:nodoc:
  include FieldNames
  attr_accessor :describeResult

  def initialize(describeResult = nil)
    @describeResult = describeResult
  end
end

# {https://services.prosper.com/ProsperAPI/}Login
#   email - SOAP::SOAPString
#   password - SOAP::SOAPString
class Login  #:nodoc:
  include FieldNames
  attr_accessor :email
  attr_accessor :password

  def initialize(email = nil, password = nil)
    @email = email
    @password = password
  end
end

# {https://services.prosper.com/ProsperAPI/}LoginResponse
#   loginResult - DefinitionResult
class LoginResponse  #:nodoc:
  include FieldNames
  attr_accessor :loginResult

  def initialize(loginResult = nil)
    @loginResult = loginResult
  end
end

# {https://services.prosper.com/ProsperAPI/}Logout
#   token - SOAP::SOAPString
class Logout  #:nodoc:
  include FieldNames
  attr_accessor :token

  def initialize(token = nil)
    @token = token
  end
end

# {https://services.prosper.com/ProsperAPI/}LogoutResponse
#   logoutResult - DefinitionResult
class LogoutResponse  #:nodoc:
  include FieldNames
  attr_accessor :logoutResult

  def initialize(logoutResult = nil)
    @logoutResult = logoutResult
  end
end

# {https://services.prosper.com/ProsperAPI/}Query
#   authenticationToken - SOAP::SOAPString
#   objectType - SOAP::SOAPString
#   fields - SOAP::SOAPString
#   conditionExpression - SOAP::SOAPString
class Query  #:nodoc:
  include FieldNames
  attr_accessor :authenticationToken
  attr_accessor :objectType
  attr_accessor :fields
  attr_accessor :conditionExpression

  def initialize(authenticationToken = nil, objectType = nil, fields = nil, conditionExpression = nil)
    @authenticationToken = authenticationToken
    @objectType = objectType
    @fields = fields
    @conditionExpression = conditionExpression
  end
end

# {https://services.prosper.com/ProsperAPI/}QueryResponse
#   queryResult - ProsperObjectResult
class QueryResponse  #:nodoc:
  include FieldNames
  attr_accessor :queryResult

  def initialize(queryResult = nil)
    @queryResult = queryResult
  end
end

# {https://services.prosper.com/ProsperAPI/}Retrieve
#   authenticationToken - SOAP::SOAPString
#   objectType - SOAP::SOAPString
#   fields - SOAP::SOAPString
#   keys - SOAP::SOAPString
class Retrieve  #:nodoc:
  include FieldNames
  attr_accessor :authenticationToken
  attr_accessor :objectType
  attr_accessor :fields
  attr_accessor :keys

  def initialize(authenticationToken = nil, objectType = nil, fields = nil, keys = nil)
    @authenticationToken = authenticationToken
    @objectType = objectType
    @fields = fields
    @keys = keys
  end
end

# {https://services.prosper.com/ProsperAPI/}RetrieveResponse
#   retrieveResult - ProsperObjectResult
class RetrieveResponse  #:nodoc:
  include FieldNames
  attr_accessor :retrieveResult

  def initialize(retrieveResult = nil)
    @retrieveResult = retrieveResult
  end
end
